/*
 * Copyright (c) 2009 Tim Mead
 *
 * Permission is hereby granted, free of charge, to any person
 * obtaining a copy of this software and associated documentation
 * files (the "Software"), to deal in the Software without
 * restriction, including without limitation the rights to use,
 * copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following
 * conditions:
 *
 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 * OTHER DEALINGS IN THE SOFTWARE.
 *
 */

/**
 * Cairngorm controller definition.
 */
package com.misoneism.fire.controller
{
	import com.adobe.cairngorm.control.FrontController;
	import com.misoneism.fire.commands.AboutApplicationCommand;
	import com.misoneism.fire.commands.HighlightIncidentCommand;
	import com.misoneism.fire.commands.InitCommand;
	import com.misoneism.fire.commands.JumpToAddressCommand;
	import com.misoneism.fire.commands.JumpToCoordinateCommand;
	import com.misoneism.fire.commands.MapReadyCommand;
	import com.misoneism.fire.commands.ShowSelectedIncidentCommand;
	import com.misoneism.fire.commands.ShutdownCommand;
	import com.misoneism.fire.commands.UpdateRSSCommand;
	import com.misoneism.fire.events.AboutApplicationEvent;
	import com.misoneism.fire.events.HighlightIncidentEvent;
	import com.misoneism.fire.events.InitEvent;
	import com.misoneism.fire.events.JumpToAddressEvent;
	import com.misoneism.fire.events.JumpToCoordinateEvent;
	import com.misoneism.fire.events.MapReadyEvent;
	import com.misoneism.fire.events.ShowSelectedIncidentEvent;
	import com.misoneism.fire.events.ShutdownEvent;
	import com.misoneism.fire.events.UpdateRSSEvent;
	
	public class Controller
			extends FrontController
	{
		public function Controller()
		{
			this.addCommands();
		}

		private function addCommands():void
		{
			addCommand(InitEvent.INIT_EVENT, InitCommand);
			addCommand(ShutdownEvent.SHUTDOWN_EVENT, ShutdownCommand);
			addCommand(UpdateRSSEvent.UPDATE_RSS_EVENT, UpdateRSSCommand);
			addCommand(ShowSelectedIncidentEvent.SHOW_SELECTED_INCIDENT_EVENT, ShowSelectedIncidentCommand);
			addCommand(MapReadyEvent.MAP_READY_EVENT, MapReadyCommand);
			addCommand(AboutApplicationEvent.ABOUT_APPLICATION_EVENT, AboutApplicationCommand);
			addCommand(JumpToAddressEvent.JUMP_TO_ADDRESS_EVENT, JumpToAddressCommand);
			addCommand(JumpToCoordinateEvent.JUMP_TO_COORDINATE_EVENT, JumpToCoordinateCommand);
			addCommand(HighlightIncidentEvent.SHOW_INCIDENT_HIGHLIGHT_EVENT, HighlightIncidentCommand);
			addCommand(HighlightIncidentEvent.HIDE_INCIDENT_HIGHLIGHT_EVENT, HighlightIncidentCommand);
		}
	}
}